/*
 * @Descripttion: 
 * @version: 
 * @@Company: DCIT-SH
 * @Author: 王富银
 * @Date: 2024-08-12 09:31:27
 * @LastEditors: Sunny Chen
 * @LastEditTime: 2024-08-20 21:28:57
 */
const sigma = 1 / (Math.sqrt(2 * Math.PI) * 12.3);
function generateNormalDistributionData(mu, sigma, numPoints) {
  const data = [];
  const step = 1 / numPoints; // x 的范围是 -5 到 5
  for (let i = 0; i <= 1; i += step) {
      const x = i;
      const y = (1 / (Math.sqrt(2 * Math.PI * sigma * sigma))) * Math.exp(-0.5 * Math.pow((x - mu) / sigma, 2));
      data.push([x, y]);
  }
  return data;
}

const mu = 0.5; // 均值
const data = generateNormalDistributionData(mu, sigma, 100);
console.log(data);
